//
//  XOCartShopTableCell.m
//  didigo
//
//  Created by JS_Coder on 2019/2/19.
//  Copyright © 2019 lifayu. All rights reserved.
//

#import "XOCartShopTableCell.h"
#import "XOShoppingCartModel.h"

@interface XOCartShopTableCell ()
@property (weak, nonatomic) IBOutlet UIView *leftBaseView;
@property (weak, nonatomic) IBOutlet UIImageView *shopImageView;
@property (weak, nonatomic) IBOutlet UILabel *shopTitleLabel;
@property (weak, nonatomic) IBOutlet UILabel *shopLimitLabel;
@property (weak, nonatomic) IBOutlet UILabel *shopTotalPriceLabel;
@end

@implementation XOCartShopTableCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.leftBaseView.layer.cornerRadius = 30;
    self.leftBaseView.layer.shadowRadius = 5;
    self.leftBaseView.layer.shadowOffset =  CGSizeMake(-1, 2);           //阴影的偏移量
    self.leftBaseView.layer.shadowOpacity = 0.8;                        //阴影的不透明度
    self.leftBaseView.layer.shadowColor = UIColorFromRGB(0xFF6684).CGColor;
    // Initialization code
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}

- (void)setShopModel:(XOShoppingCartModel *)shopModel {
    _shopModel = shopModel;
    [self setShopData];
}

- (void)setShopData {
    [self.shopImageView setImageWithUrl:self.shopModel.logo];
    self.shopTitleLabel.text = self.shopModel.shopName;
    self.shopLimitLabel.text = [NSString stringWithFormat:@"%.2f",self.shopModel.minBuyMomeny.floatValue];
    self.shopTotalPriceLabel.text = [NSString stringWithFormat:@"%.2f€",self.shopModel.totalAmount.floatValue];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
